package qldc.pm.tiensu.action;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;

import com.liferay.portal.kernel.servlet.SessionMessages;
import com.liferay.portal.kernel.util.ParamUtil;

public class TangThuAction {

	public void addTangThu(ActionRequest request, ActionResponse response) throws IOException {
		SimpleDateFormat sdf = new SimpleDateFormat();
		String redirect = ParamUtil.getString(request, "redirect","");
		String soBienNhan                     = ParamUtil.getString(request,"soBienNhan", "");
		String maHoSo                     = ParamUtil.getString(request,"maHoSo", "");
		String hoVaTen                     = ParamUtil.getString(request,"hoVaTen", "");
		String diaChi                     = ParamUtil.getString(request,"diaChi", "");
		String toiDanh                     = ParamUtil.getString(request,"toiDanh", "");
		Date ngayLuu                     = ParamUtil.getDate(request,"ngayLuu", sdf, null);
		boolean lapMoi                     = ParamUtil.getBoolean(request,"lapMoi", false);
		String viTriLuu                     = ParamUtil.getString(request,"viTriLuu", "");
		String chuThich                     = ParamUtil.getString(request,"deXuat", "");
		long idMaDoiTuong = 0L;
		String SoSoHoKhau = "";
		try {
//			TangThuLocalServiceUtil.addTangThu(SoSoHoKhau, diaChi, idMaDoiTuong, hoVaTen, ngayLuu, viTriLuu, lapMoi, chuThich);
			response.sendRedirect(redirect);

		} catch(Exception e){
			SessionMessages.add(request, "loi");
			response.sendRedirect(redirect);
		}


	}
}
